package com.ruoyi.game.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 房间对象 game_room
 * 
 * @author ruoyi
 * @date 2025-04-18
 */
public class GameRoom extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 房间ID */
    private Long id;

    /** 房间号(唯一) */
    @Excel(name = "房间号(唯一)")
    private String roomCode;

    /** 房主ID */
    @Excel(name = "房主ID")
    private Long ownerId;

    /** 最大玩家数 */
    @Excel(name = "最大玩家数")
    private Integer playerNum;

    /** 状态(0等待,1进行,2结束) */
    @Excel(name = "状态(0等待,1进行,2结束)")
    private Integer status;

    /** $column.columnComment */
    private String delFlag;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 无人时间（用于回收房间），如果有人则是未来时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "无人时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date nobodyTime;

    public Integer getCurrentPlayerNum() {
        return currentPlayerNum;
    }

    public void setCurrentPlayerNum(Integer currentPlayerNum) {
        this.currentPlayerNum = currentPlayerNum;
    }

    /** 当前房间实际人数（内存计算，不存数据库） */
    private Integer currentPlayerNum;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setRoomCode(String roomCode) 
    {
        this.roomCode = roomCode;
    }

    public String getRoomCode() 
    {
        return roomCode;
    }

    public void setOwnerId(Long ownerId) 
    {
        this.ownerId = ownerId;
    }

    public Long getOwnerId() 
    {
        return ownerId;
    }

    public void setPlayerNum(Integer playerNum)
    {
        this.playerNum = playerNum;
    }

    public Integer getPlayerNum()
    {
        return playerNum;
    }

    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }


    public void setEndTime(Date endTime)
    {
        this.endTime = endTime;
    }

    public Date getEndTime()
    {
        return endTime;
    }

    public Date getNobodyTime() {
        return nobodyTime;
    }

    public void setNobodyTime(Date nobodyTime) {
        this.nobodyTime = nobodyTime;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("roomCode", getRoomCode())
            .append("ownerId", getOwnerId())
            .append("playerNum", getPlayerNum())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("endTime", getEndTime())
            .append("nobodyTime", getNobodyTime())
            .append("remark", getRemark())
            .append("delFlag", getDelFlag())
            .toString();
    }

}
